package com.qf.task;

import com.qf.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Component
@Slf4j
public class UserTask {
    @Autowired
    private UserService userService;
    @Scheduled(cron = "00 27 22 * * ?")
    public void deleNotAvtiveUser9(){
        //查询超过三天的未激活的用户的Id
        List<Integer> ids = userService.findNotActiveDevUserOverThreeDays();
      if(ids!=null&& ids.size()>0 ){
          System.out.println("删除了");
       log.info("【定时删除未激活别的用户】,ids={}",ids);
       userService.deleteByIds(ids);

      }
         }

}
